#include <stdio.h>
#include <string.h>

int main(int argc, const char *argv[]) {
    char tmp;
    char a[10] = "hello";
    int i, len = strlen(a);
    char *p = a;
    for(i = 0; i < len / 2; i++) {
        tmp = *(p + i);
        *(p + i) = *(p + len - 1 - i);
        *(p + len - 1 - i) = tmp;
    }
    printf("%s\n", a);


    /*
    //老师的做法
    char a[128];
    gets(a);
    char *head = *a[0];
    char *tail = &a[0] + (strlen(a) - 1);
    while() {
        temp = *head;
        *head = *tail;
        *tail = temp;
        head++;
        tail--;
    }
    */
    return 0;
}

